package com.gscitysfy.cus.drain.modules.stat.controller;


import com.gscitysfy.cloudfrmwk.assistant.domain.Result;
import com.gscitysfy.cus.drain.modules.stat.dto.DrainDispatchDangerStatInfoDto;
import com.gscitysfy.cus.drain.modules.stat.dto.DrainRescueTimeStatInfoDto;
import com.gscitysfy.cus.drain.modules.stat.service.IDrainRescueTimeStatService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Tag(name = "统计分析")
@RestController
@RequestMapping("/stat/drainRescueTime")
public class DrainRescueTimeStatController {

    @Resource
    IDrainRescueTimeStatService drainRescueTimeStatService;

    @GetMapping("/getStatInfo")
    @Operation(summary = "抢险时长统计查询", description = "抢险时长统计查询")
    @Parameters({
            @Parameter(required = false, name = "st", description = "开始时间示例2022-11-17 16:01:24"),
            @Parameter(required = false, name = "et", description = "结束时间示例2022-11-17 16:01:24"),
            @Parameter(required = false, name = "name", description = "任务名称"),
    })
    public Result<DrainRescueTimeStatInfoDto> getStatInfo(String st, String et, String name) {
        return Result.content(drainRescueTimeStatService.getStatInfo(st,et,name));
    }

    @GetMapping("/getDispatchDangerStatInfo")
    @Operation(summary = "内涝险情统计-空间分布", description = "内涝险情统计-空间分布")
    @Parameters({
            @Parameter(required = false, name = "st", description = "开始时间示例2022-11-17 16:01:24"),
            @Parameter(required = false, name = "et", description = "结束时间示例2022-11-17 16:01:24"),
    })
    public Result<List<DrainDispatchDangerStatInfoDto>> getDispatchDangerStatInfo(String st, String et) {
        return Result.content(drainRescueTimeStatService.getDispatchDangerStatInfo(st,et));
    }

    @GetMapping("/getTaskStatInfo")
    @Operation(summary = "抢险任务统计-空间分布", description = "抢险任务统计-空间分布")
    @Parameters({
            @Parameter(required = false, name = "st", description = "开始时间示例2022-11-17 16:01:24"),
            @Parameter(required = false, name = "et", description = "结束时间示例2022-11-17 16:01:24"),
    })
    public Result<List<DrainDispatchDangerStatInfoDto>> getTaskStatInfo(String st, String et) {
        return Result.content(drainRescueTimeStatService.getTaskStatInfo(st,et));
    }
}